<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div{
            width: 200px;
            height: 200px;
            background-color: pink;
            padding:10px;
            border:15px solid red;
            margin:20px;
        }
    </style>
</head>
<body>
    <div></div>

    <script src="./jquery.min.js"></script>
    <script>
        $(function(){
            //获取元素宽高
            console.log($("div").width());
            console.log($("div").height());

            //获取元素宽高+内边距
            console.log($("div").innerWidth());
            console.log($("div").innerHeight());

            //获取元素宽高+内边距+边框
            console.log($("div").outerWidth());
            console.log($("div").outerHeight());

            //获取元素宽高+内边距+边框+外边距
            console.log($("div").outerWidth(true));
            console.log($("div").outerHeight(true));
        })
        
    </script>
</body>
</html>